<?php

use yii\helpers\Html;
use yii\widgets\ActiveForm;

?>


<!DOCTYPE html>
<html>
<head>
  <title></title>
  <meta http-equiv="X-UA-Compatible" content="IE=edge" />
  <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" />
  <meta name="apple-mobile-web-app-capable" content="yes" />
  <meta name="apple-mobile-web-app-status-bar-style" content="black" />
  <meta name="format-detection" content="telephone=no" />
  <link href="/css/style.css" rel="stylesheet">
  <script type="text/javascript" src="http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js"></script>
 
</head>
<body>

    <div class="registration-form">
         
        <div class="registration-form">
         
        <?php $form = ActiveForm::begin([
		 'options'=>['class' => 'demoform'],
		'id'=>'form111']); ?>


            <div style="display: none" id="forum" class="view">
                <div class="wapper6 wapper">
                    <img id="lt" src="/img/lt.png">
                    <ul style="margin-top:6%">
                        <li>
                            <span>选择您希望参加的分论坛</span><span style="width:auto;float:right;margin-right:10px;background:rgba(221,78,66,0.8);color:#fff;padding:0 5px;height:24px;border-radius:2px;margin-top:3px;" onClick='chong();'>重选</span>
                        </li>
                        <li>
                            <input type="checkbox" name="Registration[frm][]" data-value=1 value="试验驱动未来网络创新" class="sw" <?= in_array('试验驱动未来网络创新',$model->frm)?'checked':''?>>
                            <span class="title">试验驱动未来网络创新</span>
                            <span class="time">5月12日上午</span>
                        </li>
                        <li>
                            <input type="checkbox" name="Registration[frm][]" data-value=3 value="未来网络学术发展与产业进展" class="qt" <?= in_array('未来网络学术发展与产业进展',$model->frm)?'checked':''?>>
                            <span class="title">未来网络学术发展与产业进展</span>
                            <span class="time">5月12日全天</span>
                        </li>
                        <li>
                            <input type="checkbox" name="Registration[frm][]"  data-value=3 value="SDN/NFV技术与应用" class="qt" <?= in_array('SDN/NFV技术与应用',$model->frm)?'checked':''?>>
                            <span class="title">SDN/NFV技术与应用</span>
                            <span class="time">5月12日全天</span>
                        </li>
                        <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=1 value="运营商未来网络变革" class="sw" <?= in_array('运营商未来网络变革',$model->frm)?'checked':''?>>
                            <span class="title">运营商未来网络变革</span>
                            <span class="time">5月12日上午 </span>

                        </li>
                         <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=3 value="2018新一代人工智能发展与网络智能服务前沿论坛" class="qt" <?= in_array('2018新一代人工智能发展与网络智能服务前沿论坛',$model->frm)?'checked':''?>>
                            <span class="title">2018新一代人工智能发展与网络智能服务前沿论坛</span>
                            <span class="time">5月12日全天</span>

                        </li>
                        <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=2 value="网络空间大数据" class="xw" <?= in_array('网络空间大数据',$model->frm)?'checked':''?>>
                            <span class="title">网络空间大数据</span>
                            <span class="time">5月12日下午</span>

                        </li>
                        <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=1 value="物联网/产业互联网" class="sw" <?= in_array('物联网/产业互联网',$model->frm)?'checked':''?>>
                            <span class="title">物联网/产业互联网</span>
                            <span class="time">5月12日上午</span>

                        </li>
                        <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=1 value="5G网络论坛" class="sw" <?= in_array('5G网络论坛',$model->frm)?'checked':''?>>
                            <span class="title">5G网络论坛</span>
                            <span class="time">5月12日上午</span>

                        </li>
                        <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=2 value="网络与信息安全" class="xw" <?= in_array('网络与信息安全',$model->frm)?'checked':''?>>
                            <span class="title">网络与信息安全</span>
                            <span class="time">5月12日下午</span>

                        </li>
                        <li>

                            <input type="checkbox" name="Registration[frm][]" data-value=3 value="全国高校未来网络新工科建设与产学合作论坛" class="qt" <?= in_array('全国高校未来网络新工科建设与产学合作论坛',$model->frm)?'checked':''?>>
                            <span class="title">全国高校未来网络新工科建设与产学合作论坛</span>
                            <span class="time">5月12日全天</span>

                        </li>
                    </ul>



                </div>
            </div>
        
<div class="top1 view" id="basic">

    <div class="wapper1 wapper">
        <img src="/img/jb.png">
    <ul>
        <li>
            <span>姓名</span>
            <input type="text" name="Registration[name]" id='name'    value="<?= $model->name?>">
            <span>性别</span>
            <input  type="radio" name="Registration[genter]" <?= $model->genter=='男'?'checked ':''?>  value="男"> <span>男</span>
            <input  type="radio" name="Registration[genter]" <?= $model->genter=='女'?'checked ':''?> value="女"> <span>女</span>
        </li>

        <li>
                <span>联系电话</span>
                <input type="text"  id='tel'   name="Registration[telephone]" value="<?= $model->telephone?>">
        </li>

        <li>
                <span>国籍</span>
                <input type="text" id='nationality'   name="Registration[nationality]" value="<?= $model->nationality?>">
        </li>

        <li>
               <span>证件类型</span>
                <select id="registration-card_type"  name="Registration[card_type]" aria-invalid="false" style="background: rgba(0,115,172,0.1);
    border: none;border-left: 2px solid rgba(0,132,177,1);margin-left:5%;">
                   
                    <option value="身份证" <?= $model->card_type=='身份证'?'selected':''?>>身份证</option>
                    <option value="护照" <?= $model->card_type=='护照'?'selected':''?>>护照</option>
                    <option value="港澳身份证" <?= $model->card_type=='港澳身份证'?'selected':''?>>港澳身份证</option>
                </select>
                
        </li>
         <li>
               <span>证件号码</span>
                
                <input type="text" id='card_num'     name="Registration[card_num]"   style='margin-left:6%;width:60%;'  value="<?= $model->card_num?>">
        </li>

        <li>
                <span>单位</span>
                <input type="text"  id='dealer' name="Registration[dealer]"  value="<?= $model->dealer?>">
        </li>

        <li>
                <span>职位</span>
                <input type="text" id='post'    name="Registration[post]" value="<?= $model->post?>">
        </li>
       
         
                
         <li style='display:none'>       <input type="hidden"     name="Registration[character]" value="<?= $character?>" ></li>
          
           
       

        <li>
                <span>备用联系人</span>
                <input type="text" id='spare_contact'   name="Registration[spare_contact]" value="<?= $model->spare_contact?>">
        </li>

        <li>
                <span>备用联系人电话</span>
                <input type="text"  style="width: 50%; "  id='spare_contact_phone' name="Registration[spare_contact_phone]" value="<?= $model->spare_contact_phone?>">
        </li>
        <li>
            <span>是否自驾</span>
            <input type="radio" name="Registration[come_transportation]" value="自驾" <?= $model->come_transportation=='自驾'?'checked':''?>> <span>是</span>
            <input type="radio" name="Registration[come_transportation]" value="" <?= $model->come_transportation==''?'checked':''?>> <span>否</span>
        </li>
        </li>
    </ul>
</div>

</div>

           <input id="pre" style="display: none" value="" type="button" onclick="test()">
            <input id="submit" style="display: none" value="" type="submit">
        <input id="next" style="width: 100px;height: 40px;background: url(../img/xia.png)no-repeat;position: absolute;right:50%;margin-right:-50px;background-size: 100% auto;border: none;margin-top:20px;" value="" type="button" >


 <?php ActiveForm::end(); ?>

         
          
        
    </div>
         
          
        
    </div>

</body>
</html>
<script>
$('#next').click(function(){
    var nationality=$('#nationality').val();if(nationality==''){alert('请填写国籍');return false;};
	var card_num=$('#card_num').val();if(card_num==''){alert('请填写证件号码');return false;};
	var cardtype=$('#registration-card_type').val();
	if(cardtype=='身份证'){
		var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            if (reg.test(card_num) === false) {
                alert("身份证输入不合法");
                return false;
             }
		
	}
	
	
	var phoneReg =  /^1\d{10}$/; 
	var name=$('#name').val();if(name==''){alert('请填写姓名');return false;};
	var tel=$('#tel').val();if(tel==''){alert('请填写联系电话');return false;};
	if(!phoneReg.test(tel)){alert('请填写正确电话');return false;};

	
	var dealer=$('#dealer').val();if(dealer==''){alert('请填写单位');return false;};

	var post=$('#post').val();if(post==''){alert('请填写职位');return false;};
    $('#basic').hide(); $('#next').hide();$('#pre').show();$('#submit').show();$('#forum').show();
	//$('#next').submit();
	
	
})

$('#submit').click(function(){

    var Registration=$('input:checkbox:checked').val();
    //alert(Registration);
    if(Registration===undefined){
        alert('请选择分论坛');return false;
    }


    $('#form111').submit();


})
function test(){
    $('#basic').show(); $('#next').show();$('#pre').hide();$('#submit').hide();$('#forum').hide();
}

lun();
function chong(){
    $('ul li input:checkbox').removeAttr("disabled");
    $('ul li input:checkbox').removeAttr("checked");
}
function lun(){
    var sum=0;
    $('input[name="Registration[frm][]"]:checked').each(function(){
        sum+=$(this).data('value');
    });
    if(sum==0){
        $('ul li input:checkbox').removeAttr("disabled");
    }
    if(sum==1){
        $(".sw:not(:checked)").attr("disabled","disabled");
        $(".qt:not(:checked)").attr("disabled","disabled");
        $('.xw').removeAttr("disabled");
    }
    if(sum==2){
        $(".xw:not(:checked)").attr("disabled","disabled");
        $(".qt:not(:checked)").attr("disabled","disabled");
        $('.sw').removeAttr("disabled");
    }
    if(sum==3){
        $(".sw:not(:checked)").attr("disabled","disabled");
        $(".xw:not(:checked)").attr("disabled","disabled");
        $(".qt:not(:checked)").attr("disabled","disabled");
    }
}
$('ul li input:checkbox').click(function(){
    lun();
});


</script>